package com.xiaoxin.dubbo.api;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xiaoxin.dubbo.mappers.AnnouncementMapper;
import com.xiaoxin.model.domain.Announcement;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @author xiaoxiaode
 * @date 2021-09-10-17:12
 **/
@DubboService(version = "1.0.0")
public class AnnouncementApiImpl implements  AnnouncementApi {

    @Autowired
    private AnnouncementMapper announcementMapper;

    public List<Announcement> selectasd(){
        QueryWrapper<Announcement> wrapper =new QueryWrapper<>();
        wrapper.orderByDesc("created");
        List<Announcement> announcements = announcementMapper.selectList(wrapper);
        return announcements;
    }
}
